<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2D变换效果</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            border: 5px solid #f00;
            font-size: 80px;
            text-align: center;
            line-height: 200px;
            margin: 50px auto;
        }
        .t1 {transform: translateX(100px);}
        .t2 {transform: translateX(0);}
        .t3 {transform: translateX(-100px);}

        .t4 {transform: translateY(100px);}
        .t5 {transform: translateY(0);}
        .t6 {transform: translateY(-100px);}

        .t7 {transform: rotate(45deg);}/* 顺时针旋转*/
        .t8 {
            transform: rotate(0);
            transform: rotate(360deg);/* 旋转一周等同于不旋转*/
        }
        .t9 {transform: rotate(-45deg);}/* 逆时针旋转 */

        .t10 {transform: scaleX(1);}/* 不翻转 */
        .t11 {transform: scaleX(-1);}/* 水平翻转 */
        .t12 {transform: scaleY(-1);}/* 垂直翻转 */
    </style>
</head>
<body>
    <!-- 水平位移 -->
    <div class="t1">1</div>
    <div class="t2">2</div>
    <div class="t3">3</div>
    <hr>
    <!-- 垂直位移 -->
    <div class="t4">4</div>
    <div class="t5">5</div>
    <div class="t6">6</div>
    <hr>
    <!-- 元素2D旋转-->
    <div class="t7">7</div>
    <div class="t8">8</div>
    <div class="t9">9</div>
    <hr>
    <!-- 特殊效果：镜面翻转 -->
    <div class="t10">10</div>
    <div class="t11">11</div>
    <div class="t12">12</div>
</body>
</html>